<template>
  <svg :class="svgClass" aria-hidden="true" :style="{ width, height, fill, color }">
    <use :xlink:href="iconName"></use>
  </svg>
</template>
<script>
export default {
  props: {
    iconClass: {
      required: true,
      type: String
    },
    className: {
      type: String
    },
    height: {
      type: String
    },
    width: {
      type: String
    },
    fill: {
      type: String
    },
    color: {
      type: String
    }
  },
  computed: {
    iconName() {
      return `#icon-${this.iconClass}`
    },
    svgClass() {
      if (this.className) {
        return this.className
      } else {
        return 'icon'
      }
    }
  }
}
</script>
<style scoped>
  .icon {
    vertical-align: middle;
    fill: currentColor;
    overflow: hidden;
  }
</style>